using System;
using Pine.SourceParser.Tree;

namespace Pine.CodeGen
{
	public static class BlockCodeGenerator
	{
		public static void GenerateBytecode(Context ctx, Statement stmt)
		{
			Block blk = (Block) stmt;
			
			ctx.il.BeginScope();
			Context innerCtx = CodeUtilities.MakeChildScope(ctx);
			
			foreach (Statement cstmt in blk.content) {
				cstmt.GenerateBytecode(innerCtx);
			}
			ctx.il.EndScope();
		}
	}
}

